package com.green.web.controller.manage;

import java.util.HashMap;
import java.util.Map;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;

import net.sf.json.JSONObject;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.green.common.page.Pagination;
import com.green.model.manage.Position;
import com.green.service.manage.PositionService;
import com.green.web.controller.common.BaseController;

/**
 * 崗位
 * @author 谷辉
 *
 */
@Controller
@RequestMapping(value = "/position/*")
public class PositionController extends BaseController{

	@Resource
	private PositionService positionService;		

	/**
	 * 查询提成发放信息
	 * 
	 * @param modelMap
	 * @return
	 */
	@RequestMapping("listData")
	@ResponseBody
	public void listData(Pagination<Position> page,HttpServletResponse response) {
		Map<String, Object> param = new HashMap<String, Object>();
		String orgId=getString("orgId");
		if(null!=orgId&&!orgId.equals("")){
		param.put("orgId",orgId );
		
		page =positionService.getPositionPagination(page, param);
		}
		outPrint(response, JSONObject.fromObject(page, getDefaultJsonConfig()));
	}	
}
